import request from '@/config/axios'

export const getSalePlanPage = async (params) => {
  return await request.getOriginalJL({
    url: '/coalSendCar/get-sale-plan-page',
    params
  })
}

export const getSegmentedDevice = async (params) => {
  return await request.getJL({
    url: '/coalSendCar/get-segmented-device',
    headers: {
      isToken: true
    },
    params
  })
}

export const getSalePlanDetail = async (params) => {
  return await request.getJL({
    url: '/coalSendCar/get-sale-plan-detail',
    headers: {
      isToken: true
    },
    params
  })
}

export const getOrderReceiveMode = async (params) => {
  return await request.getJL({
    url: '/queue/tenant-config/get-order-receive-mode',
    headers: {
      isToken: true
    },
    params
  })
}

export const refreshAuthorize = async () => {
  return await request.getDYXT({
    url: '/account-authorize/refresh-authorize'
  })
}

export const addsaleplan = async (data) => {
  return await request.postOriginalDYXT({
    url: '/sale-plan/add',
    data
  })
}

export const selectProductByCustomerId = async (params) => {
  return await request.getJL({
    url: '/queue/sale-waybill/select-product-by-customerId',
    params
  })
}

export const getDispatchPage = async (params) => {
  return await request.getDYXT({
    url: '/bidding/dispatch-page',
    params
  })
}

export const getSmallPackageList = async (params) => {
  return await request.getDYXT({
    url: '/bidding/get-small-package-list',
    params
  })
}

export const getBiddingInfo = async (params) => {
  return await request.getDYXT({
    url: '/basic-config/get-bidding-info',
    params
  })
}

export const deletePlan = async (id, enterId, cusId) => {
  return await request.deleteDYXT({
    url: `/sale-plan/delete/${id}/${enterId}/${cusId}`
  })
}
